﻿//-----------------------------------------------------------------------
// <copyright file="SaveDestinationProvider.cs" author="Artak Mkrtchyan">
//     Creative Commons - GNU General Public License (http://creativecommons.org/licenses/GPL/2.0/
// </copyright>
// <author>Artak Mkrtchyan</author>
// <email>mkArtak@gmail.com</email>
// <date>02/06/2013</date>
//-----------------------------------------------------------------------

using System.Windows.Forms;

namespace ConsoleHoster.Common.Model
{
	public class SaveDestinationProvider : ISaveDestinationProvider
	{
		public SaveDestinationProvider()
		{
		}

		public string ProvideData(string argCurrentState)
		{
			string tmpResult = null;

			using (SaveFileDialog tmpDialog = new SaveFileDialog())
			{
				tmpDialog.CheckPathExists = true;
				tmpDialog.Filter = this.Filter;
				tmpDialog.FileName = argCurrentState;

				DialogResult tmpDialogResult = tmpDialog.ShowDialog();
				if (tmpDialogResult == DialogResult.OK)
				{
					tmpResult = tmpDialog.FileName;
				}
			}

			return tmpResult;
		}

		public string Filter
		{
			get;
			set;
		}
	}
}
